﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;

namespace Young3.FMSearch.Core.Entities.InGame
{
    public static partial class PositionalRatings
    {
        private static Func<PlayerSkills, decimal> __cbRatings = null;
        public static Func<PlayerSkills, decimal> CBRatings
        {
            get
            {
                if (__cbRatings == null)
                {
                    __cbRatings = (p) =>
                        (Convert.ToDecimal(
                        p.FirstTouch*10 +
                        p.Heading*100+
                        p.Marking*80+
                        p.Passing*20+
                        p.Tackling*100+
                        p.Technique*20+
                        
                        p.Aggression*20+
                        p.Anticipation*40+
                        p.Bravery*60+
                        p.Composure*20+
                        p.Concentration*40+
                        p.Decisions*40+
                        p.Influence*20+
                        p.Positioning*80+
                        p.Teamwork * 40+
                        p.Workrate*20+
                        
                        p.Acceleration *50+
                        p.Agility *25+
                        p.Balance*20+
                        p.Jumping*80+
                        p.Pace*50+
                        p.Stamina*20+
                        p.Strength*80
                        )
                        / Convert.ToDecimal((10+100+80+20+100+20+20+40+60+20+40+40+
                        40+20+80+40+20+50+25+20+80+50+20+80) * 100));
                }
                return __cbRatings;
            }
        }
    }
}
